Skip to content

Instantly share code, notes, and snippets.

@dustingraham
dustingraham / AutoSave.cs
Last active May 18, 2024 10:57
Auto-Save open unity scenes when launching play mode, or every five minutes.
#if UNITY_EDITOR
using System;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
[InitializeOnLoad]
public class AutoSave
{
private static DateTime nextSaveTime;
@AlecSchneider
AlecSchneider / python_on_iphone.sh
Last active May 18, 2024 10:53
How to install apk and Python on your iPhone using the iSH Shell
cd
# you can do this all in one command
wget -qO- http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86/apk-tools-static-2.10.5-r1.apk | tar -xz sbin/apk.static && ./sbin/apk.static add apk-tools && rm sbin/apk.static
apk add python3
@martinsam16
martinsam16 / docker-wsl2.md
Last active May 18, 2024 10:50
How to install wsl2 ubuntu + docker + docker-compose

Activate wsl2

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2

Install and Configure Ubuntu

@tobz
tobz / steps.md
Last active May 18, 2024 10:49
Migrate Radarr from SQLite to Postgres

Migration steps

  1. Upgrade Radarr to at least v4.1.0.6133 or newer. This brings in support for Postgres. This will also ensure that all of your SQLite tables have the latest schema migrations applied before we migrate to Postgres. If you want to upgrade further, that's fine too, but make sure you've completed all upgrades first before continuing.
  2. Create your Postgres databases (one for the "main" database and one for the "logs" database) and configure Radarr with the relevant Postgres credentials. Both databases need to be owned by/accessible from the same Postgres user.
  3. Restart Radarr, and ensure it connects to Postgres and runs all schema migrations.
  4. Once all schema migrations have been applied, and no other activity is occurring, stop Radarr.
  5. Copy the SQLite databases from the Radarr instance/pod, both the main database and logs database. For this guide, we'll assume these files are called radarr.db and logs.db.
  6. Using pg_dump -s, dump the schema for the main Radarr database . P
@dbrentley
dbrentley / beltmatic.py
Last active May 18, 2024 10:53
Beltmatic Optimizer
from collections import deque
"""
Beltmatic Optimizer
Author: Brent Douglas (https://github.com/dbrentley)
Edit the two variables "max_number" and "target". max_number is the
highest number you have unlocked and target is the target you are trying
to reach.
"""
@CGArtPython
CGArtPython / circle_mesh_part_1.py
Created May 16, 2022 00:30
Beginner Blender Python Exercise: Circle mesh from scratch (Part 1) https://www.youtube.com/watch?v=uOQ-CPcaqMo
# give Python access to Blender's functionality
import bpy
# extend Python's math functionality
import math
# extend Python's print functionality
import pprint
# initialize paramaters
@dmdboi
dmdboi / discord_oauth.js
Created September 20, 2020 13:08
Two functions to authenticate a Discord User and get User's data
var axios = require('axios');
var qs = require('qs');
exports.getAccessToken = (code) => {
var data = qs.stringify({
'client_id': '',
'client_secret': '',
'grant_type': 'authorization_code',
'code': code,
'redirect_uri': '',

Proxmox VE Installation on Hetzner Server via Rescue System

Follow these steps to install Proxmox VE on a Hetzner server via the Rescue System. The Rescue System is a Linux-based environment that can be booted into to perform system recovery tasks. We'll be using it to install Proxmox VE.

In order to complete the process, it is indeed necessary to first boot into the Rescue System and then connect to it via SSH. This will allow you to run the commands for installing Proxmox VE. Here are the steps:

Starting the Rescue System

  1. Log into the Hetzner Robot.
  2. Under "Main Functions; Server" select the desired server and then open the tab "Rescue".
@Yanivmd
Yanivmd / LateX Diff with Overleaf
Last active May 18, 2024 10:27
LateX Diff with Overleaf
Follow this:
https://github.com/comaniac/latex-proj-tool
After install, you do:
python3 -m latex_proj_tool flat old_project/main.tex --output old.tex
main.tex points to main file, the script will find the rest.
For latexdiff, use this online tool:
https://3142.nl/latex-diff/
@napsternxg
napsternxg / LatexDiffOverleaf.md
Last active May 18, 2024 10:26
Doing diff for latex projects on Overleaf

Steps for doing latexdiff

  • Download 2 versions from overleaf
  • Compile them using the TexStudio. I should create a bbl file.
  • Create a new tex file where you replace the bibliography section with the contents of the bbl file.
  • Do the same for the other version of the file.
  • Check that the new tex file for both version compiles to the same contents of the original tex files.
  • Open https://3142.nl/latex-diff/ and paste the contents of the new tex files from both versions in the text boxes.
  • Click the box named "Generate LateX document showing differences"
  • It will take some time and then create the diff file.